#ifndef __DISPLAY_H
#define __DISPLAY_H
#include "./opencv/opencv.h"
#include "../v4l2/videoframe.h"
#include <string.h>
#include <iostream>
using namespace std;

#define __MAX_DISPLAY_OBJS 256
struct display_obj
{
    uint8_t id;
    uint8_t class_id;
    uint8_t type;
    uint8_t color;
    uint8_t startx;
    uint8_t starty;
    uint8_t width;
    uint8_t height;
    float conf;
    string str;
};

struct display_objs{
    uint8_t count;
    struct display_obj obj[__MAX_DISPLAY_OBJS];
};

class OPENCV;
class DISPLAY
{
    private:
        struct display_objs objs_pool;
    protected:
        OPENCV *m_opencv;
    public:
        struct list_head head;
    private:
    protected:
    public:
        int start();
        void update(uint8_t *data);
        void process(struct video_frame* frame);

        DISPLAY();
        DISPLAY(uint32_t width,uint32_t height,uint32_t pixfmt);
        ~DISPLAY();
};
#endif